package com.yanqu.road.entity.enums.activity.huashigang;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author wpj
 * @Date 2020/10/3
 */
public enum eHuaShiGangEventType {
    NORMAL_MONSTER("普通怪物事件", 1, eHuaShiGangEventBigType.NORMAL_EVENT.getValue()),
    CREAM_MONSTER("精英怪物事件", 2, eHuaShiGangEventBigType.CREAM_EVENT.getValue()),
    BOSS_MONSTER("BOSS事件", 3, eHuaShiGangEventBigType.BOSS_EVENT.getValue()),
    UNEXPECTED_EVENT("意外事件", 4, eHuaShiGangEventBigType.NORMAL_EVENT.getValue()),
    TRADE_EVENT("贸易事件", 5, eHuaShiGangEventBigType.NORMAL_EVENT.getValue()),
    BOX_EVENT("宝箱事件", 6, eHuaShiGangEventBigType.NORMAL_EVENT.getValue()),
    TREASURE_EVENT("藏宝事件", 7, eHuaShiGangEventBigType.TREASURE_EVENT.getValue()),
    SHOP_EVENT("商店事件", 8, eHuaShiGangEventBigType.NORMAL_EVENT.getValue()),
    EMPTY_EVENT("空事件", 9, eHuaShiGangEventBigType.EMPTY_EVENT.getValue()),
    BOSS_TREASURE_EVENT("BOSS藏宝事件", 10, eHuaShiGangEventBigType.BOSS_TREASURE_EVENT.getValue()),
    ;

    private String name; //事件名称

    private int intValue;//事件类型

    private int bigType;//事件大类型

    eHuaShiGangEventType(String name, int value, int bigType) {
        intValue = value;
        this.name = name;
        this.bigType = bigType;
    }

    /**
     * 普通据点事件类型
     * @return
     */
    public static List<Integer> getNormalEventTypeValues() {
        List<Integer> values = new ArrayList<>();
        for (eHuaShiGangEventType type : eHuaShiGangEventType.values()) {
            if (type.getBigType() == eHuaShiGangEventBigType.NORMAL_EVENT.getValue()) {
                values.add(type.getValue());
            }
        }
        return values;
    }

    /**
     * 精英怪据点事件类型
     * @return
     */
    public static List<Integer> getCreamEventTypeValues() {
        List<Integer> values = new ArrayList<>();
        for (eHuaShiGangEventType type : eHuaShiGangEventType.values()) {
            if (type.getBigType() == eHuaShiGangEventBigType.CREAM_EVENT.getValue()) {
                values.add(type.getValue());
            }
        }
        return values;
    }

    /**
     * 藏宝据点事件类型
     * @return
     */
    public static List<Integer> getTreasureEventTypeValues() {
        List<Integer> values = new ArrayList<>();
        for (eHuaShiGangEventType type : eHuaShiGangEventType.values()) {
            if (type.getBigType() == eHuaShiGangEventBigType.TREASURE_EVENT.getValue()) {
                values.add(type.getValue());
            }
        }
        return values;
    }

    /**
     * BOSS据点事件类型
     * @return
     */
    public static List<Integer> getBossEventTypeValues() {
        List<Integer> values = new ArrayList<>();
        for (eHuaShiGangEventType type : eHuaShiGangEventType.values()) {
            if (type.getBigType() == eHuaShiGangEventBigType.BOSS_EVENT.getValue()) {
                values.add(type.getValue());
            }
        }
        return values;
    }

    /**
     * 空事件类型
     */
    public static List<Integer> getEmptyEventTypeValues() {
        List<Integer> values = new ArrayList<>();
        for (eHuaShiGangEventType type : eHuaShiGangEventType.values()) {
            if (type.getBigType() == eHuaShiGangEventBigType.EMPTY_EVENT.getValue()) {
                values.add(type.getValue());
            }
        }
        return values;
    }

    /**
     * boss宝库类型
     */
    public static List<Integer> getBossTreasureEventTypeValues() {
        List<Integer> values = new ArrayList<>();
        for (eHuaShiGangEventType type : eHuaShiGangEventType.values()) {
            if (type.getBigType() == eHuaShiGangEventBigType.BOSS_TREASURE_EVENT.getValue()) {
                values.add(type.getValue());
            }
        }
        return values;
    }

    /**
     * 判断是否是怪物事件
     * @param eventType
     * @return
     */
    public static boolean isMonsterEvent(int eventType) {
        if (BOSS_MONSTER.getValue() == eventType || NORMAL_MONSTER.getValue() == eventType || CREAM_MONSTER.getValue() == eventType) {
            return true;
        }
        return false;
    }

    /**
     * 判断是否是藏宝事件
     * @param eventType
     * @return
     */
    public static boolean isTreasureEvent(int eventType) {
        if (TREASURE_EVENT.getValue() == eventType) {
            return true;
        }
        return false;
    }

    /**
     * 判断是否是贸易事件
     * @param eventType
     * @return
     */
    public static boolean isTradeEvent(int eventType) {
        if (TRADE_EVENT.getValue() == eventType) {
            return true;
        }
        return false;
    }

    /**
     * 获取大类型，根据小类型
     * @param type
     * @return
     */
    public static int getBigTypeByType(int type) {
        for (eHuaShiGangEventType eHuaShiGangEventType : eHuaShiGangEventType.values()) {
            if (eHuaShiGangEventType.getValue() == type) {
                return eHuaShiGangEventType.getBigType();
            }
        }
        return 0;
    }


    public int getValue() {
        return intValue;
    }

    public String getName() {
        return name;
    }

    public int getBigType() {
        return bigType;
    }
}
